package com.polytech.diploma.SQLGenerator.Oracle.DBEntityGenerators;

import java.io.Serializable;

import com.polytech.diploma.DBTablesHelper.DBEntities.MP;

public class MPGenerator implements DBEntityGenerator, Serializable {

	private static long serialVersionUID = 1L;
	public transient static MPGenerator mpGenerator = null;
	
	public static MPGenerator getInstance() {
		if(mpGenerator == null)
		{
			mpGenerator = new MPGenerator();
		}
		return mpGenerator;
	}
	
	public MP generateMP(String sqlText)
	{
		MP mp = new MP();
		mp.setMp("MP_"+serialVersionUID);
		mp.setCreateMPScript("CREATE TABLE " + mp.getMp() + " AS " + sqlText + ";\r\n");
		mp.setDropMPScript("DROP TABLE " + mp.getMp() + ";\r\n");
		return mp;
	}
}
